summaryrefslogtreecommitdiff
path: root/ui/routes/(login)/invite/[invite]/+page.js
blob: 32c929044e2561006111febd092ae3f587ac004e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { getInvite } from '$lib/apiServer';

async function loadInvite(invite) {
	let response = await getInvite(invite);
	switch (response.status) {
		case 200: {
			let invite = response.data;
			return invite;
		}
		case 404:
			return null;
		default:
			// TODO: display error.
			break;
	}
}

export function load({ params }) {
	let { invite } = params;
	return {
		invite: loadInvite(invite)
	};
}